package cn.iocoder.yudao.module.pypm.dal.mysql.iteration;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.pypm.dal.dataobject.iteration.IterationDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.pypm.controller.admin.iteration.vo.*;

/**
 * 迭代信息 Mapper
 *
 * @author 钦州码头
 */
@Mapper
public interface IterationMapper extends BaseMapperX<IterationDO> {

    default PageResult<IterationDO> selectPage(IterationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IterationDO>()
                .eqIfPresent(IterationDO::getProjectId, reqVO.getProjectId())
                .betweenIfPresent(IterationDO::getCreateTime, reqVO.getCreateTime())
                .betweenIfPresent(IterationDO::getStartDate, reqVO.getStartDate())
                .betweenIfPresent(IterationDO::getEndDate, reqVO.getEndDate())
                .eqIfPresent(IterationDO::getDescribe, reqVO.getDescribe())
                .orderByDesc(IterationDO::getId));
    }

}